package com.dqyt.khjc.controller;

import java.util.List;

import com.dqyt.khjc.bean.ResultMsg;
import com.dqyt.khjc.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletRequest;


/**
 * 短信--控制器
 * 
 * @author 王植平
 * @version 1.0
 * @date 创建时间：2019年8月20日 上午11:57:24
 * @parameter
 * @since
 * @return
 *
 */
@RestController
public class SmsController {

	/**
	 * 每次发短信的隔离时间
	 */
	public final static long V_TIME = 60 * 1000L;

	/**
	 * 短信是否已经验证
	 */
	public final static int IS_USED = 1;

	/**
	 * 短信是否已经验证有效时间
	 */
	public final static long V_V_TIME = 5 * 60 * 1000L;

	@Autowired
	private SmsService mSmsService;





	/**
	 * 得到短信验证码
	 * 
	 * @return
	 */
	@RequestMapping(value = "/api/getSmsCode", method = {RequestMethod.GET,RequestMethod.POST})
	public ResultMsg getSmsCode(HttpServletRequest request, String phone) {
		ResultMsg resultMsg = mSmsService.getSmsCode(request,phone);
		return resultMsg;
	}

}